<script src="/ueditor/ueditor.config.js"></script>
<script src="/ueditor/ueditor.all.min.js"></script>
<script src="/ueditor/lang/zh-cn/zh-cn.js"></script>
<div class="content">
    <form id="edit-form" class="form-horizontal nice-validator n-default n-bootstrap" role="form" data-toggle="validator" method="POST" action="" novalidate="novalidate">
        <input type="hidden" name="id" value="{$res.id}"/>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">产品信息类别:</label>
            <div class="col-xs-12 col-sm-8">
               <!-- <select name="info_type">
                    {volist name="info_type" id="vo" key="k"}
                          <option value="{$k}"  {if condition="$res.info_type eq $k"} selected="selected" {/if}  disabled="disabled">{$vo}</option>
                    {/volist}
                </select>-->
                <span>{$info_type[$res['info_type']]}</span>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">标题:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="title" class="form-control" name="title" value="{$res.title}" type="text" disabled="disabled">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">外链地址:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="linkto" class="form-control" name="linkto" type="text" value="{$res.linkto}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">状态:</label>
            <div class="col-xs-12 col-sm-8">
                <input  name="status"  value="0" type="radio" {if condition="$res.status eq 0"}checked="checked" {/if}>显示
                <input  name="status"  value="1" type="radio" {if condition="$res.status eq 1"}checked="checked" {/if}>隐藏
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">内容:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea name="info" id="info">{$res.info}</textarea>
            </div>
        </div>
        <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <button type="button" class="btn btn-success btn-embossed" onclick="sub();">确定</button>
                <a href="{:url('info_index',array('p_id'=>$res['p_id']))}" class="btn btn-default btn-embossed">返回</a>
            </div>
        </div>
    </form>

</div>
<script language="javascript" type="text/javascript" src="/assets/My97DatePicker/jquery-1.8.2.js"></script>
<script>
    function sub(){
         var title=$("#title").val();
         if(title==''){
             alert("标题不得为空");
             return;
         }

         $("#edit-form").submit();
    }
</script>
<script type="text/javascript">
    UE.getEditor('info', {
        theme:"default", //皮肤
        lang:"zh-cn", //语言
        initialFrameWidth:1078,  //初始化编辑器宽度,默认800
        initialFrameHeight:320//  初始化编辑器高度
    });
</script>
